home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_lockerpatch.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  162 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_LockerPatch.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     activated
  14.  
  15.     thing       player      local
  16.     thing       indy        local
  17.     thing       t_Item      local
  18.     
  19.     thing       door
  20.     thing       offsetCam
  21.     thing       ghost_Thing
  22.     thing       cam1
  23.     thing       camTarg
  24.     thing       ghostPos        # move player to this pos
  25.     thing       walk_Targ       # walk indy to this pos
  26.     
  27.     template    tpl_Thing=patchkitmove      local
  28.     template    tpl_Actor=indy_actor        local
  29.     
  30.     sound       snd_Open=fol_lockr_opn.wav        local
  31.     sound       snd_Close=fol_lockr_cls.wav       local
  32.     
  33.     sound       snd_Patch=INXJ241.wav        local # a raft repair kit
  34.     
  35.     cog         talkCog     local
  36.     
  37.     flex        openDoor    local
  38.     
  39.     int         open=0      local
  40.     int         playing=0   local
  41.     int         bin_Num=56  local
  42.  
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. startup:
  50.  
  51.     player = GetLocalPlayerThing();
  52.     SetThingLight(door, '0.25 0.25 0.25', 0.1, 0.5);
  53.     return;
  54.     
  55. # ========================================================================================
  56.  
  57. activated:
  58.  
  59.     if((GetSenderRef() == door) && (open == 0) && (playing == 0))
  60.     {
  61.         Call openDoor;
  62.     }
  63.     
  64.     return;
  65.     
  66. # ========================================================================================
  67.  
  68. openDoor:
  69.  
  70.     # do cutscene stuff
  71.     MakeMeStop();
  72.     StartCutscene(0);
  73.     
  74.     # put away any weapon
  75.     DeselectWeaponWait(player);
  76.     
  77.     # nudge door
  78.     PlayMode(player, 60, 0);
  79.     Sleep(0.3);
  80.     
  81.     # create item
  82.     t_Item = CreateThing(tpl_Thing, ghost_Thing);
  83.     CaptureThing(t_Item);
  84.     
  85.     Sleep(0.5);
  86.     
  87.     # switch to camera inside locker
  88.     SetCameraFocus(2, cam1);
  89.     SetCameraSecondaryFocus(2, camTarg);
  90.     SetCurrentCamera(2);
  91.     
  92.     # move player away from door
  93.     CopyOrientAndPos(ghostPos, player);
  94.     
  95.     # create indy actor
  96.     indy = CreateThing(tpl_Actor, player);
  97.     CaptureThing(indy);
  98.     
  99.     # outfit indy actor
  100.     CopyPlayerHolsters(player, indy);
  101.     
  102.     # hide player show indy
  103.     SetThingFlags(player, 0x80000);
  104.     ClearThingFlags(indy, 0x80000);
  105.     
  106.     Sleep(0.5);
  107.     
  108.     PlaySoundLocal(snd_Open, 1.0, 0.0, 0x0, 0);
  109.     Rotate(door, -90, 1, 1.0);
  110.     WaitForStop(door);
  111.     
  112.     Sleep(0.5);
  113.     
  114.     # indy walks up to locker
  115.     AISetCutsceneMode(indy);
  116.     AISetMoveSpeed(indy, 1.0);
  117.     AISetLookThing(indy, walk_Targ);
  118.     AISetMoveThing(indy, walk_Targ, 1);
  119.  
  120.     # RT: Swap player back in so lips move...
  121.     CopyOrientAndPos(indy, player);
  122.     SetThingFlags(indy, 0x80000);
  123.     ClearThingFlags(player, 0x80000);
  124.     
  125.     # reach for the item
  126.     PlayMode(player, 60, 0);
  127.     Sleep(0.3);
  128.     DestroyThing(t_Item);
  129.     
  130.     # Call the Pickup Lines cog
  131.     talkCog = GetCogByIndex(0);
  132.     SendMessage(talkCog, 27);
  133.     
  134.     # sleep to wait for talkCog
  135.     Sleep(1.3);
  136.     
  137.     # add item to inventory
  138.     ChangeInv(player, bin_Num, 1.0);
  139.     SetInvAvailable(player, bin_Num, 1);
  140.     SetInvDisabled(player, bin_Num, 1);
  141.     JonesInvItemChanged(bin_Num);
  142.         
  143.     # Johnny, tell the player what he's picked up
  144.     PlayVoice(player, snd_Patch, 1.0, 1);
  145.  
  146.     # restore camera
  147.     SetCameraPosition(1, GetThingPos(offsetCam));
  148.     SetCurrentCamera(1);
  149.     
  150.     # return control to player
  151.     ClearActorFlags(player, 0x200000);
  152.     EndCutscene();
  153.     
  154.     playing = 0;
  155.     open = 1;
  156.     
  157.     return;
  158.     
  159. # ========================================================================================
  160.  
  161. end
  162.